home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / bbs_util / tgdev301.zip / TELEGARD.H < prev    next >
C/C++ Source or Header  |  1996-06-09  |  90KB  |  1,746 lines

  1. /*****************************************************************************/
  2. /*>                                                                         <*/
  3. /*>                     Telegard Bulletin Board System                      <*/
  4. /*>         Copyright 1995,1996 by Tim Strike.    All rights reserved.      <*/
  5. /*>                                                                         <*/
  6. /*>                      Data types and structures                          <*/
  7. /*>                                                                         <*/
  8. /*****************************************************************************/
  9. /*****************************************************************************/
  10. /* --------------- IMPORTANT NOTICE -- PLEASE READ CAREFULLY --------------- */
  11. /*****************************************************************************/
  12.  
  13. /*                                                           June 9th, 1996
  14.  
  15.   Note to all Telegard 3.0 developers;
  16.  
  17.   These structures are the final release structures for Telegard 3.0.
  18.  
  19.   These structures may be used to modify and create new programs which
  20.   will be compatible with Telegard 3.0.  Enclosed with this structure kit
  21.   are several documents which outline the various date file formats that
  22.   Telegard 3.0 uses.  The development documentation, DEVEL300.DOC, has
  23.   many helpful hints and information regarding most of the data files which
  24.   Telegard uses -- please read it before attempting to use the data
  25.   structures.
  26.  
  27.   The structures have been commented as best as possible.  If you need
  28.   more information on how to use/access data within these structures,
  29.   please see the accompanying documentation for contact methods.
  30.  
  31.   Several portions of these structures outline multinode capabilities.  As
  32.   of Telegard 3.0, the BBS is not fully multinode compatible.  A release
  33.   will be made as soon as possible which will accomodate full multinode
  34.   features.  Until then, presume that the features that have been outlined
  35.   in this document are up-to-date and working in Telegard 3.0.
  36.  
  37.   Thanks for your interest in Telegard 3.0.  Utility developers who wish
  38.   more information regarding distribution should look at the accompanying
  39.   documentation -- there are several helpful areas which should be read.
  40.  
  41.   We can use all the questions, comments and ideas that you can think of.
  42.  
  43.   Thanks,
  44.   Telegard 3.0 Development Team
  45.  
  46. */
  47.  
  48. #ifndef __TELEGARD_H
  49. #define __TELEGARD_H
  50.  
  51. /*****************************************************************************/
  52. /* ----------------------- CONSTANT DEFINITIONS ---------------------------- */
  53. /*****************************************************************************/
  54.  
  55. #define TG_VER              "3.0"      /* TG's version this header is for */
  56.  
  57. #define MAXARCS             10         /* archive commands (1..max) */
  58. #define MAXPROTOCOL         26         /* protocol records (A..Z)   */
  59. #define MAXLEVEL            26         /* level records (A..Z)      */
  60. #define MAXEVENTS           16         /* scheduled events (0..max) */
  61.                                        /* 0 = -X[n] cmd (RESERVED)  */
  62. #define MAXMENUCMDS         75         /* menu commands (1..max) */
  63. #define MAXQUEUE            20         /* queue storage (1..max) */
  64. #define NUMVOTEAS           16         /* voting answers (0..max) */
  65. #define NUMVOTEQS           20         /* voting questions (1..max) */
  66.  
  67. #define MJAM                1          /* JAM format */
  68. #define MSQUISH             2          /* Squish format */
  69.  
  70. #define MLOCAL              1          /* Local */
  71. #define MNETMAIL            2          /* Netmail */
  72. #define MECHOMAIL           3          /* Echomail */
  73.  
  74. #define MPUBLIC             1          /* Public Messages */
  75. #define MPRIVATE            2          /* Private Messages */
  76.  
  77. #define ATNO                1          /* No anonymous allowed */
  78. #define ATYES               2          /* Anonymus allowed */
  79. #define ATFORCED            3          /* Forced anonymous */
  80. #define ATDEARABBY          4          /* "Dear Abby" message base */
  81. #define ATANYNAME           5          /* Anyname posting */
  82.  
  83. /*---------------------------------------------------------------------------*/
  84.  
  85. typedef unsigned char boolean;         /* Turbo Pascal "boolean" */
  86. typedef unsigned char byte;            /* Turbo Pascal "byte" */
  87. typedef signed short int integer;      /* Turbo Pascal "integer" */
  88. typedef signed long int longint;       /* Turbo Pascal "longint" */
  89. typedef unsigned char string;          /* Turbo Pascal "string" */
  90. typedef unsigned short int word;       /* Turbo Pascal "word" */
  91. typedef unsigned int bit;              /* shorthand for C bit fields */
  92.  
  93. /*****************************************************************************/
  94. /* ------------------------ TYPE DEFINITIONS ------------------------------- */
  95. /*****************************************************************************/
  96.  
  97. typedef string acstring[41];           /* Access Control system string */
  98. typedef integer intrange[256];         /* security tables - integers */
  99. typedef byte byterange[256];           /* security tables - bytes */
  100.  
  101. typedef longint unixtime;              /* unix time stamp - seconds */
  102.                                        /* since 01/01/70 */
  103.  
  104. typedef byte acrq[4];                  /* AR Flags */
  105. typedef acrq acrqs;                    /* AR Flags set */
  106.  
  107. typedef struct          /* user AC flags */
  108. {
  109.     bit rlogon : 1;                    /* L - One call per day */
  110.     bit rchat : 1;                     /* C - Can't page the SysOp */
  111.     bit rnetmaildel : 1;               /* F - Force Netmail deletion */
  112.     bit ramsg : 1;                     /* A - Can't post AutoMessage */
  113.     bit rpostan : 1;                   /* * - Can't post anonymously */
  114.     bit rpostpvt : 1;                  /* E - Can't post private */
  115.     bit rpostnet : 1;                  /* N - Can't post NetMail */
  116.     bit rpost : 1;                     /* P - Can't post at all */
  117.     bit rvoting : 1;                   /* K - Can't vote */
  118.     bit rmsg : 1;                      /* M - Forced email deletion */
  119.     bit rpostecho : 1;                 /* G - Can't post EchoMail */
  120.     bit fnodlratio : 1;                /* 1 - No UL/DL ratio */
  121.     bit fnopostratio : 1;              /* 2 - No post/call ratio */
  122.     bit fnofilepts : 1;                /* 3 - No file points checking */
  123.     bit fnodeletion : 1;               /* 4 - Protection from deletion */
  124.     bit fnodailyratio : 1;             /* 5 - No daily DL ratio */
  125.     bit fnodltime : 1;                 /* 6 - No DL time check */
  126.     bit fnopwchange : 1;               /* 7 - No forced pw change */
  127.     bit ftimepercall : 1;              /* 8 - Time on per call basis */
  128. }
  129. uflags;
  130.  
  131. typedef struct          /* Bitmapped date format */
  132. {
  133.     word date;                         /* date  5432109876543210 */
  134.                                        /*       Y------M---D---- */
  135.     word time;                         /* time  5432109876543210 */
  136.                                        /*       H----M-----S---- */
  137. }
  138. bitmapdate;
  139.  
  140.  
  141. /*****************************************************************************/
  142. /* ------------------- CONFIGURATION DATA STRUCTURES ----------------------- */
  143. /*****************************************************************************/
  144.  
  145. typedef struct          /* CONFIG.TG - System configuration */
  146. {
  147.     word versionid;                    /* version (eg $3000 = V3.0) */
  148.     string datapath[80];               /* DATA path */
  149.     string textpath[80];               /* TEXT path */
  150.     string langpath[80];               /* LANGUAGES path */
  151.     string menupath[80];               /* MENUS path */
  152.     string logspath[80];               /* LOG path */
  153.     string msgpath[80];                /* MSGS path */
  154.     string semaphore[80];              /* SEMAPHORE path */
  155.     string attchpath[80];              /* FILE ATTACH path */
  156.     string swappath[80];               /* SWAP path */
  157.     string arcpath[41];                /* ARCHIVE path */
  158.     string protpath[41];               /* PROTOCOL path */
  159.     string filepath[80];               /* FILE path */
  160.     byte reserved1[120];               /* RESERVED */
  161.  
  162.     string bbsname[81];                /* BBS name */
  163.     string bbsphone[21];               /* BBS phone number */
  164.     string bbslocation[51];            /* BBS location */
  165.     string sysopname[31];              /* SysOp's full name or alias */
  166.     boolean multinode;                 /* System is Multinode? */
  167.     string bulletprefix[9];            /* default bulletin prefix */
  168.     boolean highbitinfo;               /* High-bit in user info? */
  169.     byte nodecheck;                    /* NodeCheck threshold (s) */
  170.     boolean nodetask;                  /* Node from TASK environment */
  171.                                        /*   if -Nnn not specified */
  172.     boolean hiddenpw;                  /* Passwords are hidden?
  173.                         1. Always verify passwords
  174.                            against user.pwcrc
  175.                         2. TRUE  user.pwtext=''
  176.                         3. FALSE check user.pwcrc
  177.                            if crc(input)=user.pwcrc
  178.                            then set user.pwtext=pw
  179.                         4. If changing pw, always
  180.                            update CRC field -- VERY
  181.                            important! */
  182.     byte reserved2[4];                 /* RESERVED  */
  183.     boolean localtimeout;              /* local timeout logoff? */
  184.     string sysoppw[21];                /* SysOp PW */
  185.     byte timeoutbell;                  /* minutes before timeout bell */
  186.     byte timeout;                      /* minutes before timeout logoff */
  187.     byte backsysoplogs;                /* days to keep SYSOP##.LOG */
  188.     byte slogtype;                     /* SysOp log type
  189.                                                 0 - File
  190.                                                 1 - Printer
  191.                                                 2 - Both */
  192.     boolean stripclog;                 /* strip colors from SysOp log? */
  193.     boolean compressbases;             /* "compress" base numbers? */
  194.     byte reserved3[100];               /* RESERVED */
  195.  
  196.     word audiolowtime;                 /* Allow audio hours */
  197.     word audiohitime;
  198.     boolean monoscreen;                /* Monochrome screen */
  199.     boolean useems;                    /* use EMS for overlay */
  200.     boolean usebios;                   /* use BIOS for local video output */
  201.     boolean cgasnow;                   /* Suppres snow on CGA systems */
  202.     byte screensize;                   /* Screen size
  203.                                                 0 - Default/Auto
  204.                                                 1 - 25
  205.                                                 2 - 28  (VGA)
  206.                                                 3 - 43/50 (EGA/VGA) lines*/
  207.     byte wfcblanktime;                 /* minutes to blank WFC screen */
  208.     byte printerport;                  /* printer port (1-3) */
  209.     byte openfiledelay;                /* OpenFile delay b/w attempts */
  210.     byte openfileatt;                  /* OpenFile attempts */
  211.     byte openfiletimeout;              /* OpenFile timeout message */
  212.     byte openfileabort;                /* OpenFile timed abort */
  213.     byte reserved4[20];                /* RESERVED */
  214.  
  215.     byte chatpagelen;                  /* Page length in seconds */
  216.     byte chatattempts;                 /* # of chat attempts */
  217.     byte sysopcolor;                   /* SysOp chat color */
  218.     byte usercolor;                    /* User chat color */
  219.     boolean chatreason;                /* ask for a chat reason? */
  220.     boolean chattime;                  /* refund chat time? */
  221.     string externalchat[80];           /* External chat command */
  222.     byte chatdoortype;                 /* Chat door file type: */
  223.                                        /*   0: none        3: WWIV */
  224.                                        /*   1: GAP         4: PCBoard  */
  225.                                        /*   2: RBBS-PC                */
  226.     byte reserved5[74];                /* RESERVED */
  227.                                                                                /* External Utilities */
  228.     string fsecmd[41];                 /* Full screen editor command */
  229.     byte fsedoortype;                  /* FSE door file type: */
  230.                                        /*   0: none        3: WWIV     */
  231.                                        /*   1: GAP         4: PCBoard  */
  232.                                        /*   2: RBBS-PC             */
  233.     byte swapshelltype;                /* swap shell type: */
  234.                                        /*   0: disk        2: XMS */
  235.                                        /*   1: EMS                 */
  236.     boolean swaponarchive;             /* swap on archive command */
  237.     boolean swapondoor;                /* swap on door command */
  238.     boolean swapondosshell;            /* swap on DOS shell */
  239.     boolean swaponevent;               /* swap on DOS Shell event */
  240.     boolean swaponfse;                 /* swap on full-screen editor */
  241.     boolean swaponsysbat;              /* swap on system batch files */
  242.     boolean swaponxfer;                /* swap on file transfer */
  243.     boolean swapshell;                 /* swap shell function enabled? */
  244.     word envspace;                     /* DOS Environment space */
  245.     byte reserved6[48];                /* RESERVED */
  246.  
  247.     intrange timeallow;                /* daily time */
  248.     byterange callallow;               /* daily calls */
  249.     byterange dlratio;                 /* # ULs/# DLs ratios */
  250.     intrange dlkratio;                 /* DLK/ULK ratios */
  251.     byterange postratio;               /* post/call ratios */
  252.     byterange dailyratio;              /* daily DL #files ratios */
  253.     intrange dailykratio;              /* daily DL KB ratios */
  254.     intrange timebankmax;              /* timebank max limit */
  255.     byterange timedeposit;             /* timebank daily deposit */
  256.     byterange timewithdraw;            /* timebank daily withdraw */
  257.  
  258.     byte ansitype;                     /* ANSI Logon -
  259.                                               0  Ask
  260.                                               1  Detect
  261.                                               2  Force NO
  262.                                               3  Force YES */
  263.     byte lastcallers;                  /* days of last callers */
  264.     byte maxlogontries;                /* tries for PW's at logon */
  265.     byte maxlogonmins;                 /* minutes allowed for logon */
  266.     boolean allowalias;                /* allow aliases? (handles) */
  267.     boolean datapw;                    /* data phone # password */
  268.     boolean voicepw;                   /* voice phone # password */
  269.     boolean localsec;                  /* is local security ON? */
  270.     boolean displaysec;                /* is local screen-security ON? */
  271.     boolean globaltrap;                /* trap ALL USER'S activity? */
  272.     boolean autochatopen;              /* does chat buffer auto-open? */
  273.     boolean languagefirst;             /* language section first? */
  274.     byte reserved6a;                   /* bulletins in logon? */
  275.     byte lcallinlogon;                 /* "Last Calls" list in logon? */
  276.     byte reserved7;                    /* RESERVED */
  277.     boolean offhooklocallogon;         /* phone off-hook for local? */
  278.     boolean forcevoting;               /* logon voting mandatory? */
  279.     boolean iemsi;                     /* allow IEMSI logons */
  280.     boolean checkmulti;                /* check for multiple logons */
  281.     byte reserved8[41];                /* RESERVED */
  282.     string logonmenu[9];               /* logon menu to start users on */
  283.     string watcharea[9];               /* area for pw attempt warnings */
  284.     string inquiryarea[9];             /* area for forgotten PW inquiry */
  285.     word passdays;                     /* # of days to change password */
  286.     boolean updatelocal;               /* local calls in statistics */
  287.     boolean timeleftbank;              /* timebank prompt w/no time? */
  288.     longint minbaud;                   /* minimum logon baudrate */
  289.     longint graphicsbaud;              /* minimum graphics baudrate */
  290.     byte reserved9[63];                /* RESERVED */
  291.  
  292.     string newapp[37];                 /* new user letter to user */
  293.     boolean opensystem;                /* allow new users? */
  294.     boolean newiemsi;                  /* allow IEMSI new user logons */
  295.     byte linelen;                      /* default video line length */
  296.     byte pagelen;                      /* default video page length */
  297.     byte datefmt;                      /* date format - 0 ASK */
  298.     boolean scanphone;                 /* scan for duplicate phone #'s? */
  299.     boolean autopassword;              /* allow auto-created PW's? */
  300.     string language[9];                /* default language, ''  ASK */
  301.     byte ansi;                         /* ANSI               0  ASK */
  302.     byte avatar;                       /* Avatar             1  YES */
  303.     byte clrscr;                       /* Clear Screen       2  NO */
  304.     byte pause;                        /* screen pause */
  305.     byte hotkeys;                      /* Hotkeys */
  306.     byte fse;                          /* Full Screen Editor */
  307.     boolean mailaddress;               /* Ask for  Mail Address? */
  308.     boolean gender;                    /*          Gender? */
  309.     boolean dataph;                    /*          Data Phone? */
  310.     boolean voiceph;                   /*          Voice Phone? */
  311.     boolean dob;                       /*          Date of Birth? */
  312.     char newuserlevel;                 /* New User Level */
  313.     byte flinput;                      /* Full-line input   0 Ask
  314.                                                             1 Yes
  315.                                                             2 No */
  316.     byte countryinput;                 /* Country input   0 Ask 
  317.                                                           1 U.S.
  318.                                                           2 Canada
  319.                                                           3 Int'l */
  320.     boolean killcolor;                 /* Strip colour from entry fields */
  321.     byte reserved10[30];               /* RESERVED */
  322.  
  323.     acstring crosspost;                /* Cross-post message ACS */
  324.  
  325.     string batchfileext[4];            /* batch filename extension */
  326.     byte reserved11[32];               /* RESERVED */
  327.  
  328.     word minspaceforpost;              /* minimum drive space to post */
  329.     boolean emaillist;                 /* allow email user listing? */
  330.     boolean smartquote;                /* use smartquote features? */
  331.     boolean quickquote;                /* use quickquote features? */
  332.     acstring ccmail;                   /* ACS to carbon copy messages */
  333.     acstring creq;                     /* ACS for request confirm receipt */
  334.     acstring fileattach;               /* ACS to attach file */
  335.     acstring normpubpost;              /* ACS to post public messages */
  336.     acstring normprivpost;             /* ACS to post private messages */
  337.     acstring normnetpost;              /* ACS to post netmail messages */
  338.     acstring nopostratio;              /* ACS for no post/call ratio */
  339.     acstring anonpubread;              /* ACS see who posted public anon */
  340.     acstring anonprivread;             /* ACS see who posted private anon */
  341.     acstring anonpubpost;              /* ACS to post anon public messages */
  342.     acstring anonprivpost;             /* ACS to post anon private message */
  343.     boolean netconfirm;                /* honor confirmation request */
  344.     boolean msguploads;                /* allow upload of messages? */
  345.     boolean nodelookup;                /* allow nodelist lookup */
  346.     acstring fileattachnet;            /* ACS attach file - netmail */
  347.     boolean antiqueUUCP;               /* antique UUCP; UUCP in header,
  348.                                              TO: in message text */   
  349.     string writescanlog[41];           /* path to ECHOMAIL.JAM/NETMAIL.JAM */
  350.     boolean checkfsesave;              /* confirm FSE save? */
  351.     byte reserved13[15];               /* RESERVED */
  352.  
  353.     acstring sop;                      /* SysOp ACS */
  354.     acstring csop;                     /* C-SysOp ACS */
  355.     acstring spw;                      /* SysOp PW at logon ACS */
  356.  
  357.     byte wfc[15];                      /* WFC Menu Colours */
  358.     boolean heartbeat;                 /* WFC "Heartbeat" */
  359.     byte reserved14[25];               /* RESERVED */
  360.  
  361.     string qwkpktname[9];              /* packet name */
  362.     string qwkwelcomefile[9];          /* BBS welcome file */
  363.     string qwknewsfile[9];             /* BBS news file */
  364.     string qwkgoodbyefile[9];          /* BBS goodbye file */
  365.     string qwklocaldlpath[41];         /* local QWK download path */
  366.     string qwklocalulpath[41];         /* local REP upload path */
  367.     byte reserved15[41];               /* RESERVED */
  368.     word qwkmaxmsgs;                   /* max messages to DL (0=unlim) */
  369.     string qwkarc[4];                  /* default archive */
  370.     boolean qwkextctrl;                /* extended CONTROL.DAT info ? */
  371.     string qwknewsgen[61];             /* news program */
  372.     string qwkfilesgen[61];            /* new files program */
  373.     byte qwknews;                      /* include news        0 Ask */
  374.     byte qwkwelcome;                   /* include welcome     1 Yes */
  375.     byte qwkgoodbye;                   /* include goodbye     2 No */
  376.     byte qwknewfiles;                  /* include new files list */
  377.     byte qwksession;                   /* include session texts */
  378.  
  379.     byte reserved16[95];               /* RESERVED */
  380.  
  381.     string ulbase[9];                  /* default UL base */
  382.     boolean showulname;                /* show upload name */
  383.     acstring blindulacs;               /* blind upload ACS */
  384.     byte filetest;                     /* file upload test type
  385.                                              0 : none
  386.                                              1 : archive integrity
  387.                                              2 : upload processor */
  388.     acstring filepwacs;                /* ACS for users to add pw */
  389.     boolean truncdesc;                 /* truncate file_id/testinfo
  390.                          imported descriptions */
  391.     byte drive_tblupd;                 /* CD-ROM drive table update
  392.                          0 : every call
  393.                                              1-254 : once every n hours
  394.                                              255 : never */
  395.     boolean searchdup;                 /* search for dupe filenames? */
  396.     boolean globaldl;                  /* global downloads allowed? */
  397.     boolean allowdldesc;               /* allow description download? */
  398.     boolean importfileid;              /* import file descriptions? */
  399.     boolean nodupeext;                 /* no check of extension on dupe files? */
  400.     boolean valallfiles;               /* validate files automatically? */
  401.     byte unlistfp;                     /* file points for unlisted DLs */
  402.     byte ulrefund;                     /* percent time refund for ULs */
  403.     byte dlchecktype;                  /* DL checking (0=off,1=UL/DL,2=points) */
  404.     word maxintemp;                    /* max KB allowed in TEMP\ARC\ */
  405.     word minspaceul;                   /* minimum KB drive space left to upload */
  406.     word ulfpkbyte;                    /* UL K-bytes per file point */
  407.     word ulfpforfile;                  /* UL # points assigned to file */
  408.     word ulfpforuser;                  /* UL # points assigned to user */
  409.     string sysopulbase[9];             /* file base for SysOp uploads */
  410.     acstring seeunval;                 /* ACS to see unvalidated files */
  411.     acstring dlunval;                  /* ACS to DL unvalidated files */
  412.     acstring ulvalreq;                 /* UL validation not-required */
  413.     string virusscanner[81];           /* Virus Scanner Command */
  414.     byte passederrlvl;                 /* Passed Scanner Errorlevel */
  415.     byte gifspectype;                  /* Gifspec type     0 Last line */
  416.                                        /*                  1 Before*  */
  417.                                        /*  *-old method, desc is      */
  418.                                        /*    truncated if necessary   */
  419.     boolean useTESTINFO;               /* import TESTINFO.DAT -- if */
  420.                                        /* virus scanner creates it.  */
  421.     string testpath[41];               /* path to TESTINFO.DAT */
  422.     boolean textview;                  /* allow text w/archive view */
  423.     boolean pausebefore;               /* pause list before next dir */
  424.     acstring dlunavail;                /* dl unavailable (failed) files */
  425. }
  426. configrec;
  427.  
  428. typedef struct          /* SYSTEM.DAT - System operational variables */
  429. {
  430.     byte usereditlvl;                  /* type of user editor */
  431.                                        /*   0 - 2,  Short - Long */
  432.     byte curwindow;                    /* type of SysOp window */
  433.     boolean istopwindow;               /* SysOp window on top? */
  434.     longint callernum;                 /* total number of callers */
  435.     boolean windowon;                  /* is SysOp window on? */
  436.     byte reserved[400];                /* RESERVED */
  437. }
  438. systemrec;
  439.  
  440. /*****************************************************************************/
  441. /* ----------------------- USER DATA STRUCTURES ---------------------------- */
  442. /*****************************************************************************/
  443.  
  444. typedef struct          /* USERS.DAT status flags */
  445. {
  446.     bit lockedout : 1;                 /* if locked out */
  447.     bit udeleted : 1;                  /* if deleted */
  448.     bit trapactivity : 1;              /* if trapping users activity */
  449.     bit trapseparate : 1;              /* if trap to separate TRAP file */
  450.     bit chatauto : 1;                  /* if autochat trapping */
  451.     bit chatseparate : 1;              /* if separate chat file to trap to */
  452.     bit slogseparate : 1;              /* if separate SysOp log kept */
  453.     bit alert : 1;                     /* alert SysOp when use logs on */
  454. }
  455. userstatus;
  456.  
  457. typedef struct          /* USERS.DAT - User flags */
  458. {
  459.     bit newusermsg : 1;                /* sent newuse message? */
  460.     bit clsmsg : 1;                    /* clear screen before messages? */
  461.     bit flinput : 1;                   /* full line input? */
  462.     bit hotkey : 1;                    /* menu hotkeys active */
  463.     bit pause : 1;                     /* pause? */
  464.     bit novice : 1;                    /* user is at novice help level */
  465.     bit hiddenlog : 1;                 /* not displayed in call/online listing */
  466.     bit hiddenlist : 1;                /* not displayed in user listings */
  467. }
  468. userflags;
  469.  
  470. typedef struct          /* USERS.DAT - User account records */
  471. {
  472.     string name[37];                   /* user name */
  473.     string realname[37];               /* real name */
  474.     string street[31];                 /* mail address */
  475.     string location[31];               /* city, province */
  476.     string postalcode[11];             /* postal code */
  477.     string voiceph[21];                /* voice phone # */
  478.     string dataph[21];                 /* data phone # */
  479.  
  480.     string pwtext[21];                 /* user password */
  481.  
  482.     /* DEVELOPERS NOTE:  The pwtext field *may* be empty.  Please observe
  483.      the following when updating passwords:
  484.  
  485.         1. All password input is UPPERCASE
  486.         2. If ConfigRec.HiddenPW = TRUE, then only the CRC32 of the password
  487.            is stored in the user record (userrec.crcpw). 
  488.         3. If ConfigRec.HiddenPW = FALSE, both the CRC32 and the actual
  489.            password are stored in the user record.
  490.        *4. When checking input passwords against the file, only the CRC32
  491.            value should be tested (the pwtext may or may not be correct).  
  492.            If ConfigRec.HiddenPW = FALSE, and the pwtext field is EMPTY, 
  493.            then after a correct password the field will be automatically
  494.            updated.  If ConfigRec.HiddenPW = TRUE, the pwtext will *not* be 
  495.            updated (this is obvious).
  496.        *5. Passwords should *only* be displayed (pwtext) if the CRC32 of
  497.            the pwtext field *matches* the pwcrc field.  Otherwise, the 
  498.            pwtext field is likely incorrect.  When changing passwords, the
  499.            user should be prompted only, not shown their previous password.
  500.     */    
  501.  
  502.     unixtime lastdate;                 /* laston date/time */
  503.     string firstdate[9];               /* firston date */
  504.     string pwdate[9];                  /* last date of PW change */
  505.     string birthdate[9];               /* Birth date */
  506.     char gender;                       /* gender - M/F */
  507.     string subdate[9];                 /* subscription started */
  508.     string expiredate[9];              /* subscription expires */
  509.     char expireto;                     /* expire to level A - Z, !=Delete */
  510.  
  511.     string comment[41];                /* SysOp comment on user */
  512.     string notes[3][41];               /* SysOp definable variables (notes files) */
  513.     string lockfile[9];                /* lockout msg to print */
  514.  
  515.     longint pwcrc;                     /* CRC-32 of users password */
  516.  
  517.     byte reserved1[14];                /* RESERVED */
  518.     byte ugraphics;                    /* user graphics protocol
  519.                                              0 : TTY - no fallback
  520.                                              1 : ANSI
  521.                                              2 : Avatar
  522.                                              3 : RIP    */
  523.     byte fallback;                     /* 2nd fallback protocol
  524.                                              1 : ANSI
  525.                                              2 : Avatar
  526.                                              3 : RIP
  527.                                              3rd TTY */
  528.     byte linelen;                      /* line length (# cols) */
  529.     byte pagelen;                      /* page length (# rows) */
  530.     userflags flags;                   /* flags (see above) */
  531.     userstatus status;                 /* status (see above) */
  532.     byte reserved2;                    /* RESERVED */
  533.  
  534.     byte sl;                           /* SL */
  535.     uflags ac;                         /* user flags */
  536.     acrqs aflags1;                     /* Access flags - Set 1 */
  537.     acrqs aflags2;                     /* Access flags - Set 2 */
  538.     longint userID;                    /* unique User-ID - THIS VALUE
  539.                                           SHOULD NOT BE CHANGED BY ANY
  540.                                           PROGRAM!! */
  541.     char level;                        /* current validation level */
  542.     byte datefmt;                      /* Date Format
  543.                                           0 - MM/DD/YY
  544.                                           1 - DD/MM/YY
  545.                                           2 - YY/MM/DD */
  546.     byte reserved7;                    /* RESERVED */
  547.     longint macroptr;                  /* pointer for MACROS.DAT (-1 = none) */
  548.     longint votedate;                  /* last vote */
  549.     byte reserved3[17];                /* RESERVED */
  550.  
  551.     char lastgroup;                    /* last group */
  552.     word lastmsg;                      /* last message base # */
  553.     word pubpost;                      /* # public posts */
  554.     word privpost;                     /* # private posts */
  555.     word netpost;                      /* # netmail posts */
  556.     string mailbox[37];                /* mailbox status
  557.                                           ''        Open/Normal
  558.                                           'CLOSED'  Closed
  559.                                           Username  Forwarded to... */
  560.     longint credit;                    /* NetMail points (credit) */
  561.     longint debit;                     /* NetMail points (debit) */
  562.     byte fsetype;                      /* FSE usage (0=never,1=always,2=ask) */
  563.     byte reserved4[32];                /* RESERVED */
  564.  
  565.     string qwkarc[4];                  /* QWK default archiver */
  566.     boolean qwkfromyou;                /* bundle from user */
  567.     boolean qwkbwctrl;                 /* create BW control file? */
  568.     boolean qwknews;                   /* include news? */
  569.     boolean qwkwelcome;                /* include welcome? */
  570.     boolean qwkgoodbye;                /* include goodbye? */
  571.     boolean qwknewfiles;               /* include new files list? */
  572.     boolean qwkpointer;                /* include pointer file? */
  573.     boolean qwksession;                /* include session listing? */
  574.     byte reserved5[23];                /* RESERVED */
  575.  
  576.     char defprotocol;                  /* default protocol (A-Z)
  577.                                           ! = Select at download time */
  578.     word lastfile;                     /* last file base # */
  579.     word uploads;                      /* amount ULed (files) */
  580.     word downloads;                    /* amount DLed (file) */
  581.     word todaydl;                      /* amount DLed today (files) */
  582.     longint uk;                        /* amount ULed (kbytes) */
  583.     longint dk;                        /* amount DLed (kbytes) */
  584.     longint todaydk;                   /* amount DLed today (kbytes) */
  585.     longint filepoints;                /* file points remaining */
  586.  
  587.     longint totaltime;                 /* total time on system */
  588.     word timebank;                     /* # mins in Time Bank */
  589.     word totalcalls;                   /* total calls to system */
  590.     integer tltoday;                   /* time left today */
  591.     integer tbtoday;                   /* bank activit +/- time */
  592.     byte todaycalls;                   /* calls to system today */
  593.     byte illegal;                      /* illegal logons */
  594.     byte vote[NUMVOTEQS];              /* voting data */
  595.     string language[9];                /* langauge */
  596.     byte reserved6;                    /* RESERVED */
  597. }
  598. userrec;
  599.  
  600. typedef struct          /* USERS.IDX - Sorted names listing */
  601. {
  602.     string name[37];                   /* user name */
  603.     integer number;                    /* user record # */
  604.                                        /*     -1 = Deleted */
  605. }
  606. useridxrec;
  607.  
  608. typedef struct          /* USERID.IDX - Sorted ID listing */
  609. {
  610.     longint userID;                    /* User-ID from user record */
  611.     integer number;                    /* user record # */
  612.                                        /*     -1 = Deleted */
  613. }
  614. IDidxrec;
  615.  
  616. /*****************************************************************************/
  617. /* ----------------------- AREA DATA STRUCTURES ---------------------------- */
  618. /*****************************************************************************/
  619.  
  620. typedef struct          /* FAREAS.IDX/MAREAS.IDX - Area index records */
  621. {
  622.     string name[9];                    /* base filename */
  623.     integer number;                    /* base record # */
  624.                                        /*     -1 = Deleted */
  625. }
  626. areaidxrec;
  627.  
  628. /*****************************************************************************/
  629. /* ---------------------- FILE AREA DATA STRUCTURES ------------------------ */
  630. /*****************************************************************************/
  631.  
  632. typedef struct          /* FAREAS.DAT status flags */
  633. {
  634.     bit fbnoratio : 1;                 /* <No Ratio> active */
  635.     bit fbvisible : 1;                 /* Visible to users w/o access? */
  636.     bit fbRESERVED1 :1;                /* RESERVED */
  637.     bit fbcdrom : 1;                   /* CD-ROM/read-only media */
  638.     bit fbusegifspecs : 1;             /* whether to use GifSpecs */
  639. }
  640. fareaflags;
  641.  
  642. typedef struct          /* FAREAS.DAT - File base records */
  643. {
  644.     string desc[41];                   /* area description */
  645.     string filename[9];                /* filename */
  646.     string infofile[9];                /* info filename */
  647.     string path[41];                   /* path */
  648.     string arctype[4];                 /* archive (''=inactive) */
  649.     byte reserved1;                    /* RESERVED */
  650.     fareaflags fstatus;                /* file area status */
  651.     acstring sysopacs;                 /* SysOp access */
  652.     acstring listacs;                  /* list/view access */
  653.     acstring nameacs;                  /* see uploader name access */
  654.     acstring ulacs;                    /* upload access */
  655.     acstring dlacs;                    /* download access */
  656.     byte scantype;                     /* scan type    0=Default ON
  657.                                                        1=Default OFF
  658.                                                        2=Always */
  659.     string cdlabel[12];                /* CD-ROM label */
  660.     unixtime createdate;               /* base creation date */
  661.     string filepath[41];               /* *.FB? storage path */
  662.     byte reserved2[42];                /* RESERVED */
  663. }
  664. farearec;
  665.  
  666. typedef struct          /* FILES.IDX - File index record */
  667. {
  668.     string filename[13];               /* filename [key] */
  669.     integer filebase;                  /* filebase */
  670.                                        /*    -1 = Deleted */
  671.     integer filerecord;                /* file offset */
  672.     byte reserved[4];                  /* RESERVED */
  673. }
  674. fileidxrec;
  675.  
  676. typedef struct          /* *.FB status flags */
  677. {
  678.     bit freedl : 1;                    /* if file is free */
  679.     bit notime : 1;                    /* if file is time check free */
  680.     bit validated : 1;                 /* if file is validated */
  681.     bit available : 1;                 /* if file is available - will */
  682.                                        /*    be toggled FALSE only */
  683.                                        /*    if failed by filescan */
  684.     bit offline : 1;                   /* if file is offline */
  685.     bit hatch : 1;                     /* if file hatched via SDS */
  686. }
  687. fbstat;
  688.  
  689. typedef struct          /* *.FB File records */
  690. {
  691.     string filename[13];               /* filename */
  692.     string description[46];            /* description */
  693.     longint extended;                  /* pointer to extended desc */
  694.                                        /*    -1 = no extended desc */
  695.     longint size;                      /* length of file (bytes) */
  696.     unixtime uldate;                   /* date uploaded */
  697.     unixtime filedate;                 /* date on file */
  698.     unixtime dldate;                   /* date last downloaded */
  699.     fbstat filestatus;                 /* file status */
  700.     word filepoints;                   /* points */
  701.     word downloads;                    /* number of downloads */
  702.     string uploader[37];               /* uploader's name */
  703.     longint passwordCRC;               /* CRC of password to dl */
  704.     byte reserved[20];                 /* RESERVED */
  705. }
  706. fbrec;
  707.  
  708. typedef struct          /* *.FBE Extended descriptions */
  709. {
  710.     string filename[13];               /* filename (for reference) */
  711.     string desc[5][46];                /* description */
  712.     longint nextlink;                  /* offset to next record */
  713.                                        /*      -1 = last record */
  714.     byte reserved[10];                 /* RESERVED */
  715. }
  716. fbextrec;
  717.  
  718. /*
  719.    The record offset into the *.FSI file is userrec.userid-1 (ie, if userid
  720.    field = 2 then the record offset into file scan tables file is 1). */
  721.  
  722. typedef struct          /* *.FSI File scan records */
  723. {
  724.     boolean filescan;                  /* base in file scan */
  725. }
  726. fbscanrec;
  727.  
  728. typedef struct          /* DRIVES.DAT : CDROM/Network label storage */
  729. {
  730.     unixtime update;                   /* last update */
  731.     byte disktype[26];                 /* drive type
  732.                                             0-2: None, Floopy, HD
  733.                                             3 : CDROM
  734.                                             4 : Network */
  735.     string disklabel[26][12];          /* drive labels */
  736. }
  737. driverec;
  738.  
  739. typedef struct          /* *.QQQ transfer queue record */
  740. {
  741.     string filename[13];               /* filename */
  742.     longint filearea;                  /* filebase # */
  743.                                        /* UL -1   SysOp Area */
  744.     string desc[46];                   /* description */
  745.     longint extended;                  /* extended descriptions in *.QQD */
  746.     string path[56];                   /* DL: path of file */
  747.     longint filepw;                    /* UL: File password */
  748.     byte reserved;                     /* RESERVED */
  749.     integer points;                    /* DL: # file points */
  750.     longint filesize;                  /* DL: filesize (bytes) */
  751.     boolean freeratio;                 /* DL: file is FREE ratio */
  752.     boolean freetime;                  /* DL: file is FREE time */
  753.     boolean readonly;                  /* DL: file is on read-only media */
  754. }
  755. queuerec;
  756.  
  757. /*****************************************************************************/
  758. /* -------------------- MESSAGE AREA DATA STRUCTURES ----------------------- */
  759. /*****************************************************************************/
  760.  
  761. typedef struct          /* MAREAS.DAT status flags */
  762. {
  763.     bit mbrealname : 1;                /* real names are forced */
  764.     bit mbvisible : 1;                 /* visible to users w/o access */
  765.     bit mbansi : 1;                    /* filter ANSI */
  766.     bit mb8bit : 1;                    /* filter 8-bit */
  767.     bit mbstrip : 1;                   /* strip center/title codes */
  768.     bit mbaddtear : 1;                 /* add tear/origin lines */
  769.     bit mbnopubstat : 1;               /* messages not added to user */
  770.                                        /*   public post total - i.e. */
  771.                                        /*   will not calculate in PCR */
  772.     bit mbnocredit : 1;                /* Netmail credit not used */
  773.     bit mbinternet : 1;                /* Internet (UUCP) handling */
  774.     bit mbfileattach : 1;              /* allow file attaches */
  775.     bit mbstripcolour : 1;             /* strip TG color codes */
  776. }
  777. mareaflags;
  778.  
  779. typedef struct          /* MAREAS.DAT - Message base records */
  780. {
  781.     string name[41];                   /* message base description */
  782.     string msgpath[41];                /* messages pathname */
  783.     string filename[9];                /* data filenames */
  784.     string infofile[9];                /* base info filename */
  785.     acstring readacs;                  /* read access */
  786.     acstring postacs;                  /* post access */
  787.     acstring sysopacs;                 /* SysOp access */
  788.     acstring netacs;                   /* network access */
  789.     word maxmsgs;                      /* max message count */
  790.     word maxdays;                      /* max days to kee messages */
  791.     mareaflags mstatus;                /* status */
  792.     byte mbformat;                     /* message base format */
  793.     byte mbtype;                       /* message base type */
  794.     byte anonymous;                    /* anonymous type */
  795.     byte mbpost;                       /* message base posting type */
  796.     string origin[51];                 /* origin line */
  797.     byte kludge_color;                 /* color of kludge line */
  798.     byte quote_color;                  /* color of quoted line */
  799.     byte tear_color;                   /* color of tear line */
  800.     byte origin_color;                 /* color of origin line */
  801.     byte addr;                         /* network address # */
  802.     byte scantype;                     /* scan type    0 = Default ON
  803.                                                        1 = Default OFF
  804.                                                        2 = Mandatory */
  805.     unixtime createdate;               /* base creation date */
  806.     longint qwkindex;                  /* QWK-permanent index */
  807.     byte text_color;                   /* color of text line */
  808.     byte reserved[40];                 /* RESERVED */
  809. }
  810. marearec;
  811.  
  812. /*
  813.    The record offset into the *.MSI file is userrec.userid-1 (ie, if userid
  814.    field = 2 then the record offset into message scan tables file is 1).
  815.    This is the same offset that is used for the Squish (*.SQL) last read
  816.    files.  The JAM (*.JLR) records can be searched for the matching userID
  817.    to load lastread record. */
  818.  
  819. typedef struct          /* *.MSI : Message scan/lastread pointers */
  820. {
  821.     boolean mailscan;                  /* base in mail scan */
  822.     boolean qwkscan;                   /* base in qwk scan */
  823. }
  824. mbscanrec;
  825.  
  826. typedef struct          /* QWK.IDX - QWK message base index */
  827. {
  828.     integer areanum;                   /* QWK area number */
  829.     string areatag[9];                 /* message base filename */
  830. }
  831. qwkidxrec;
  832.  
  833. typedef struct          /* packetid.QPT - QWK lastread pointer record */
  834. {
  835.     integer areanum;                   /* QWK area number */
  836.     longint lastread;                  /* last read pointer */
  837. }
  838. qptrrec;
  839.  
  840. /*****************************************************************************/
  841. /* ----------------------- OTHER DATA STRUCTURES --------------------------- */
  842. /*****************************************************************************/
  843.  
  844. typedef struct          /* Menu header status flags */
  845. {
  846.     bit clrscrbefore : 1;              /* C - clrscr before menu? */
  847.     bit dontcenter : 1;                /* D - don't center titles! */
  848.     bit forcefullline : 1;             /* F - force full line input */
  849.     bit nomenuprompt : 1;              /* N - no menu prompt */
  850.     bit forcepause : 1;                /* P - force pause before menu? */
  851.     bit autotime : 1;                  /* T - auto time display? */
  852.     bit dontcentersub : 1;             /* S: don't center subtitles! */
  853.     bit forcekey : 1;                  /* K: force key input */
  854. }
  855. menuflags;
  856.  
  857. typedef struct          /* *.MNU Menu header */
  858. {
  859.     string menutitle[3][101];          /* menu titles */
  860.     string dispfile[13];               /* help file displayed */
  861.                                        /*  ''        Generic */
  862.     string helpfile[13];               /* tutorial help file */
  863.                                        /*     ''      Generic */
  864.                                        /*   '*OFF*'   Disabled */
  865.     string prompt[121];                /* menu prompt */
  866.     acstring menuacs;                  /* access requirements */
  867.     string password[16];               /* password required */
  868.     string fallback[9];                /* fallback menu */
  869.     byte helplevel;                    /* forced help level for menu */
  870.     byte columns;                      /* generic menu: # of columns */
  871.     byte colours[6];                   /* generic menu: colors */
  872.     menuflags menuflags;               /* menu status variables */
  873.     boolean global;                    /* load global menu */
  874.     word reserved1;                    /* RESERVED */
  875.     string nodestat[37];               /* Who's Online Status */
  876.     byte reserved2[10];                /* RESERVED */
  877. }
  878. menurec;
  879.  
  880. typedef struct          /* *.MNU  Command records */
  881. {
  882.     string ldesc[71];                  /* long description */
  883.     string sdesc[36];                  /* short description */
  884.     byte reserved[16];                 /* RESERVED */
  885.     string keys[15];                   /* execute keys */
  886.                                        /*   'FIRSTCMD' = Exec. Menu Loaded */
  887.                                        /*   'TITLE' = Sub-title */
  888.                                        /*   'ENTER' = <ENTER> */
  889.                                        /*   'SPACE' = <SPACEBAR> */
  890.     acstring acs;                      /* access requirements */
  891.     string cmdtype[3];                 /* command type */
  892.     string options[51];                /* command options */
  893.     byte viewtype;                     /* display of command */
  894.                                        /*    0   ACS dependent */
  895.                                        /*    1   Always visible */
  896.                                        /*    2   Always hidden */
  897. }
  898. commandrec;
  899.  
  900. /*---------------------------------------------------------------------------*/
  901.  
  902. typedef struct          /* *.BBS - BBS Listings */
  903. {
  904.     string phone[21];                  /* BBS phone number */
  905.     string name[31];                   /* BBS name */
  906.     string sysop[31];                  /* BBS SysOp name */
  907.     string description[31];            /* Other Description */
  908.     string speed[5];                   /* Speed */
  909.     string software[9];                /* Software */
  910.     unixtime firstdate;                /* First date added */
  911.     unixtime lastedit;                 /* Last date edited */
  912.     string editor[37];                 /* entry editor */
  913. }
  914. bbslistrec;
  915.  
  916. /*---------------------------------------------------------------------------*/
  917.  
  918. typedef struct          /* ARCHIVE.DAT - Archiver Setup */
  919. {
  920.     boolean active;                    /* is this format active? */
  921.     string extension[4];               /* archive extension */
  922.     string description[51];            /* archiver description */
  923.     string compress[51];               /* pack archive command */
  924.     string decompress[51];             /* unpack archive command */
  925.     string test[51];                   /* test archive command */
  926.     string view[51];                   /* view archive command */
  927.                                        /*  '' = internal (if avail)  */
  928.     string comment[51];                /* comment archive command */
  929.     byte success;                      /* sucess errorlevel */
  930.     boolean viewcapture;               /* redirect external viewer */
  931.     byte reserved[34];                 /* RESERVED */
  932. }
  933. archiverec;
  934.  
  935. /*---------------------------------------------------------------------------*/
  936.  
  937. typedef struct           /* GROUPS.DAT - Groups data */
  938. {
  939.    acstring acs;                       /* ACS requirement */
  940.    string name[41];                    /* name of group */
  941.    boolean visible;                    /* visible w/o ACS */
  942.    byte reserved[20];
  943. }
  944. groupsrec[27];                         /* groups @, A-Z */
  945.  
  946. /*---------------------------------------------------------------------------*/
  947.  
  948. typedef struct          /* EVENTS.DAT status flags */
  949. {
  950.     bit active : 1;                    /* event is active */
  951.     bit busyduring : 1;                /* phone off-hook during event */
  952.     bit monthly : 1;                   /* event is executed monthly */
  953.     bit forced : 1;                    /* event is forced */
  954. }
  955. eventflags;
  956.  
  957. typedef struct          /* EVENTS.DAT - Scheduled event records */
  958. {
  959.     eventflags flags;                  /* status flags */
  960.     string desc[31];                   /* description */
  961.     char etype;                        /* Event type:
  962.                                                 A:ACS,
  963.                                                 C:Chat,
  964.                                                 E:External,
  965.                                                 O:OS */
  966.     string execdata[41];               /* Event data:
  967.                                                 ACS:  ACS command
  968.                                                 OS:   OS command
  969.                                                 Exit: ERRORLEVEL for exit */
  970.     word exectime;                     /* execution time (minutes) */
  971.     word duration;                     /* event duration (minutes) */
  972.     byte execdays;                     /* monthly: day (1-28) */
  973.                                        /* daily: days (bitwise) */
  974.     unixtime lastexec;                 /* date event last executed */
  975.     word node;                         /* affected nodes (0=all) */
  976. }
  977. eventrec[MAXEVENTS];
  978.  
  979. /*---------------------------------------------------------------------------*/
  980.  
  981. typedef struct          /* HISTORY.DAT - History logs */
  982. {
  983.     string date[9];                    /* history date */
  984.     word userbaud[26];                 /* logon BPS rates */
  985.                                        /*      0 - Local   10 - 16800 */
  986.                                        /*      1 - 300     11 - 19200 */
  987.                                        /*      2 - 1200    12 - 21600 */
  988.                                        /*      3 - 1275    13 - 24000 */
  989.                                        /*      4 - 2400    14 - 26400 */
  990.                                        /*      5 - 4800    15 - 28800 */
  991.                                        /*      6 - 7200    16 - 38400 */
  992.                                        /*      7 - 9600    17 - 57600 */
  993.                                        /*      8 - 12000   18 - 64000 */
  994.                                        /*      9 - 14400   19 - 115200 */
  995.     word active;                       /* % activity */
  996.     word calls;                        /* # of calls */
  997.     word newusers;                     /* # of new users */
  998.     word pubpost;                      /* # of public posts */
  999.     word privpost;                     /* # of private posts */
  1000.     word netpost;                      /* # of netmail posts */
  1001.     word criterr;                      /* # of critical errors */
  1002.     word uploads;                      /* # of uploads */
  1003.     word downloads;                    /* # of downloads */
  1004.     longint uk;                        /* amount ULed in KB */
  1005.     longint dk;                        /* amount DLed in KB */
  1006.     byte reserved[16];                 /* RESERVED */
  1007. }
  1008. historyrec;
  1009.  
  1010. /*---------------------------------------------------------------------------*/
  1011.  
  1012. typedef struct          /* IEMSI.DAT - IEMSI connection record */
  1013. {
  1014.     string realname[37];               /* User's Real Name */
  1015.     string handle[37];                 /* User's Handle */
  1016.     string location[31];               /* User's Location */
  1017.     string dataph[21];                 /* User's Data Phone # */
  1018.     string voiceph[21];                /* User's Voice Phone # */
  1019.     string password[21];               /* User's Password */
  1020.     unixtime birthdate;                /* User's Birthdate */
  1021.     byte linelen;                      /* Screen Width */
  1022.     byte pagelen;                      /* Screen Length */
  1023.     byte screentype;
  1024.     string protocols[11];              /* Protocol to use */
  1025.                                        /*      DZA* DirectZAP Zmodem
  1026.                                                ZAP* ZedZap Zmodem -> 8K
  1027.                                                ZMO  Zmodem -> 1K (Z)
  1028.                                                SLK* SEAlink
  1029.                                                KER* Kermit  */
  1030.     string capabilities[26];           /* System Capabilities */
  1031.                                        /*      CHT*    IEMSI chats
  1032.                                                MNU*    Image Downloading
  1033.                                                TAB*    TAB support
  1034.                                                ASCII8* 8-bit ASCII supprt */
  1035.     string requests[41];               /* Requests */
  1036.                                        /*      NEWS    Bulletins, news, etc.
  1037.                                                MAIL*   Logon - Mail Check
  1038.                                                FILE*   Logon - File Check
  1039.                                                HOT     Hot-Keys
  1040.                                                CLR     Screen clearing
  1041.                                                HUSH*   Do not disturb
  1042.                                                MORE    Page pausing
  1043.                                                FSED    Full-screen editor */
  1044.     string software[71];               /* Terminal Software */
  1045. }
  1046. iemsirec;
  1047.  
  1048.     /*
  1049.     *These items are are currently not supported in Telegard because they
  1050.     are things which were provided for systems with these capabilities.  They
  1051.     are listed here for convenience and so that utility authors can make
  1052.     use of them if neccessary.  Some of these options may be used in
  1053.     future versions of Telegard.
  1054.  
  1055.     (Z)The protocol that is selected by having the ZMO flag is protocol Z.
  1056.     If that protocol does not exist, it is not selected.  Protocol Z should
  1057.     be ZMODEM, otherwise the wrong protocol may be selected! */
  1058.  
  1059. /*---------------------------------------------------------------------------*/
  1060.  
  1061. typedef struct          /* LANGUAGE.DAT - Language records */
  1062. {
  1063.     string filename[9];                /* language filename */
  1064.     string desc[31];                   /* language description */
  1065.     acstring acs;                      /* language ACS */
  1066.     string textpath[76];               /* primary text path */
  1067.     string menuspath[76];              /* primary menus path */
  1068.                                        /*   '' = use default */
  1069.     boolean checktext;                 /* if primary path <> '' */
  1070.     boolean checkmenus;                /*   and file not found, check */
  1071.                                        /*   default path? */
  1072. }
  1073. languagerec;
  1074.  
  1075.  
  1076. /*---------------------------------------------------------------------------*/
  1077.  
  1078. typedef struct          /* LASTON.DAT  - Last callers records */
  1079. {
  1080.     longint caller;                    /* system caller number */
  1081.     string realname[37];               /* real name of caller */
  1082.     string handle[37];                 /* user name of caller */
  1083.     string location[31];               /* location of caller */
  1084.     longint logonspeed;                /* logon speed */
  1085.     unixtime logontime;                /* logon time */
  1086.     boolean newuser;                   /* was newuser? */
  1087.     byte reserved1;                    /* RESERVED */
  1088.     boolean hidden;                    /* hidden from display */
  1089.     byte node;                         /* node number */
  1090.     unixtime logofftime;               /* logoff time */
  1091.     word uploads;                      /* number of uploads */
  1092.     word downloads;                    /* number of downloads */
  1093.     longint uk;                        /* number of upload kB */
  1094.     longint dk;                        /* number of download kB */
  1095.     byte reserved2[8];                 /* RESERVED */
  1096. }
  1097. lcallers;
  1098.  
  1099. /*---------------------------------------------------------------------------*/
  1100.  
  1101. typedef struct          /* LEVELS.DAT - Membership/validation levels */
  1102. {
  1103.     string desc[51];                   /* Description */
  1104.     byte sl;                           /* SL level */
  1105.     acrqs flags1;                      /* Access flags - Set 1 */
  1106.     acrqs flags2;                      /* Access flags - Set 2 */
  1107.     uflags ac;                         /* Restriction flags */
  1108.     word addfp;                        /* Bonus FilePoinsts (added) */
  1109.     word addcredit;                    /* Bonus NetCredits (added) */
  1110.     word addtb;                        /* Bonus Timebank (added) */
  1111.     word expireday;                    /* Expire in ## days */
  1112.                                        /*      0 = Never */
  1113.     char tolevel;                      /* Expire to level A thru Z */
  1114.                                        /*      ! = Delete */
  1115.     byte reserved[25];                 /* RESERVED */
  1116. }
  1117. levelsrec;
  1118.  
  1119. /*---------------------------------------------------------------------------*/
  1120.  
  1121. typedef struct          /* MACRO.DAT - Keyboard macro records */
  1122. {
  1123.     longint userid;                    /* User-ID - from user record
  1124.                                             checked to verify that macro
  1125.                                             pointers are to the correct
  1126.                                             macros */
  1127.     string macro[4][241];              /* stored keystrokes */
  1128. }
  1129. macrorec;
  1130.  
  1131. /*---------------------------------------------------------------------------*/
  1132.  
  1133. typedef struct          /* MODEM.DAT/MODEMnnn.DAT status flags */
  1134. {
  1135.     bit xonxoff : 1;                /* XON/XOFF (software) flow ctl */
  1136.     bit ctsrts : 1;                 /* CTS/RTS (hardware) flow ctl */
  1137.     bit dtrdrop : 1;                /* drop DTR to hangup modem */
  1138.     bit fossilhot : 1;              /* FOSSIL active during DOS */
  1139.     bit int14 : 1;                  /* INT 14 driven (no fossil) */
  1140. }
  1141. modemflags;
  1142.  
  1143. typedef struct          /* MODEM.DAT/MODEMnnn.DAT - Modem configuration */
  1144. {
  1145.     string desc[51];                   /* modem reference description */
  1146.     byte comport;                      /* COM port number */
  1147.     longint waitbaud;                  /* modem bps rate */
  1148.     longint lockedbaud;                /* locked bps rate */
  1149.                                        /*    0 = Not Locked */
  1150.     string init[81];                   /* initialization command */
  1151.     string answer[41];                 /* answer command */
  1152.     string hangup[41];                 /* hangup command */
  1153.     string offhook[41];                /* phone off-hook command */
  1154.     string code_ok[17];                /* OK result code */
  1155.     string code_error[17];             /* ERROR result code */
  1156.     string code_ring[17];              /* RING result code */
  1157.     string code_nocarrier[17];         /* NO CARRIER result code */
  1158.     string code_arq[17];               /* error correction string */
  1159.     string code_connect[25][17];       /* connect strings */
  1160.                                        /*   1 - 300     11 - 19200
  1161.                                             2 - 1200    12 - 21600
  1162.                                             3 - 1275    13 - 24000
  1163.                                             4 - 2400    14 - 26400
  1164.                                             5 - 4800    15 - 28800
  1165.                                             6 - 7200    16 - 38400
  1166.                                             7 - 9600    17 - 57600
  1167.                                             8 - 12000   18 - 64000
  1168.                                             9 - 14400   19 - 115200
  1169.                                            10 - 16800  */
  1170.     byte reinittime;                   /* inactivity re-initialization */
  1171.     byte delay_cmd;                    /* delay after cmd (1/10th) */
  1172.     byte delay_answer;                 /* answer delay (1/10th) */
  1173.     byte delay_dtr;                    /* delay for DTR drop (1/10th) */
  1174.     modemflags flags;                  /* status flags (see above) */
  1175.     byte irq;                          /* irq for non-standard port */
  1176.     string address[5];                 /* base I/O address for port */
  1177.     byte ansrings;                     /* # rings before answering */
  1178.     byte ansreset;                     /* seconds before counter reset */
  1179.     byte reserved[67];                 /* RESERVED */
  1180. }
  1181. modemrec;
  1182.  
  1183. /*---------------------------------------------------------------------------*/
  1184.  
  1185. typedef struct          /* NETWORK.DAT status flags */
  1186. {
  1187.     bit nstrip : 1;                    /* strip message codes? */
  1188.     bit naddtear : 1;                  /* add tear/origin lines? */
  1189.     bit nholduser : 1;                 /* hold all non-SysOp Netmail? */
  1190.     bit nhold : 1;                     /* def Netmail to "hold"? */
  1191.     bit ncrash : 1;                    /* def NetMail to "crash"? */
  1192.     bit nkill : 1;                     /* def NetMail to "kill/sent"? */
  1193.     bit nstripcolour : 1;              /* strip TG color codes ? */
  1194. }
  1195. netflags;
  1196.  
  1197. typedef struct          /* NETWORK.DAT - Net Address */
  1198. {
  1199.     word zone, net, node, point;       /* Zone:Net/Node.Point */
  1200. }
  1201. netaddress;
  1202.  
  1203. typedef struct          /* NETWORK.DAT - Node Information */
  1204. {
  1205.     netaddress addr;                   /* Zone:Net/Node.Point */
  1206.     word akazone;                      /* aka matching Zone:Net */
  1207.     word akanet;                       /* if net=0, match Zone only */
  1208.     string replynet[9];                /* areaname of netreplies for AKA */
  1209.     byte reserved[18];                 /* RESERVED */
  1210. }
  1211. netaddrrec;
  1212.  
  1213. typedef struct          /* NETWORK.DAT - Network Information */
  1214. {
  1215.     netaddrrec netaddr[20];            /* network addresses */
  1216.     string origin[51];                 /* origin line */
  1217.     byte kludge_color;                 /* color of kludge line */
  1218.     byte quote_color;                  /* color of quoted text */
  1219.     byte tear_color;                   /* color of tear line */
  1220.     byte origin_color;                 /* color of origin line */
  1221.     netflags flags;                    /* status flags */
  1222.     acstring readacs;                  /* default read ACS */
  1223.     acstring postacs;                  /* default post ACS */
  1224.     byte text_color;                   /* color of text line */
  1225.     byte areaformat;                   /* default area format */
  1226.     byte areascan;                     /* default scan type */
  1227.     byte defaddr;                      /* default address */
  1228.     byte reserved1[37];                /* RESERVED */
  1229.     string nodepath[41];               /* Nodelist path */
  1230.     byte nodelisttype;                 /* Nodelist type
  1231.                                               0 : None
  1232.                                               1 : Version 6
  1233.                                               2 : Version 7
  1234.                                               3 : FrontDoor */
  1235.     netaddress UUCPgate;               /* Zone:Net/Node.Point */
  1236.     acstring sysopacs;                 /* default sysop ACS */
  1237.     byte reserved2[26];                /* RESERVED */
  1238. }
  1239. networkrec;
  1240.  
  1241. /*---------------------------------------------------------------------------*/
  1242.  
  1243. typedef struct          /* NODES.DAT : Who's Online status flags */
  1244. {
  1245.     bit ishidden : 1;                  /* user is hidden */     
  1246.     bit isquiet : 1;                   /* user not to be disturbed */
  1247. }
  1248. whosonflags;
  1249.  
  1250. typedef struct          /* NODES.DAT - Multi-Node setup */
  1251. {
  1252.     boolean active;                    /* node can accept calls */
  1253.     word logonbegin;                   /* logon starts (0-1440) */
  1254.     word logonend;                     /* logon ends (0-1440) */
  1255.     acstring logonacs;                 /* access to logon */
  1256.     longint logonbps;                  /* minimum logon bps */
  1257.     string nodephone[21];              /* Node Phone Number */
  1258.     byte reserved1[45];                /* RESERVED */
  1259.  
  1260.     string realname[37];               /* realname */
  1261.     string handle[37];                 /* handle */
  1262.     string location[31];               /* location */
  1263.     unixtime logontime;                /* logon time */
  1264.     byte statusid;                     /* 0 - waiting for call
  1265.                                           1 - unavailable (offline/down)
  1266.                                           2 - event
  1267.                                           3 - CONNECTED
  1268.                                           4 - waiting for reset */
  1269.     string string[37];                 /* status */
  1270.     longint bpsrate;                   /* bps rate */
  1271.     longint userid;                    /* user-ID */
  1272.     whosonflags flags;                 /* status flags */
  1273.     byte reserved2[45];                /* RESERVED */
  1274. }
  1275. nodesrec;
  1276.  
  1277. /*---------------------------------------------------------------------------*/
  1278.  
  1279. typedef struct          /* PROTOCOL.DAT - File transfer protocols */
  1280. {
  1281.     string desc[26];                   /* description */
  1282.     boolean active;                    /* active? */
  1283.     boolean batch;                     /* batch? (=filelist) */
  1284.     acstring acs;                      /* access control */
  1285.     string ulcmd[61];                  /* UL command line */
  1286.     string dlcmd[61];                  /* DL command line */
  1287.     string ulcode[3][7];               /* UL result code */
  1288.     string dlcode[3][7];               /* DL result code */
  1289.     string envcmd[61];                 /* environment command */
  1290.     string templog[26];                /* temporary log file */
  1291.     string flist[6];                   /* DL file list */
  1292.     byte logpf;                        /* log - word # (filename) */
  1293.     byte logpr;                        /* log - word # (result) */
  1294.     boolean success;                   /* results = success? */
  1295.     boolean bidirec;                   /* bi-directional */
  1296. }
  1297. protrec;
  1298.  
  1299. /*---------------------------------------------------------------------------*/
  1300.  
  1301. typedef struct          /* SHORTMSG.DAT -  Logon messages/receipts */
  1302. {
  1303.     longint userid;                    /* to user id (0=deleted) */
  1304.     string msg[156];                   /* message */
  1305.     byte msgid;                        /* msgid - INTERNAL USE
  1306.                                           should *always* be 0
  1307.                                           if set by external utils */
  1308.     byte reserved[4];                  /* RESERVED */
  1309. }
  1310. shortmsgrec;
  1311.  
  1312. /*---------------------------------------------------------------------------*/
  1313.  
  1314. typedef struct          /* SMACROS.DAT : SysOp Macros */
  1315. {
  1316.     string macro[10][121];             /* SysOp Macros F1..F10 */
  1317. }
  1318. smacrorec;
  1319.  
  1320. /*---------------------------------------------------------------------------*/
  1321.  
  1322. typedef struct          /* TIMELOG.DAT - Daily/hourly usage tracking */
  1323. {
  1324.     unixtime startdate;                /* date graph started */
  1325.     word busyperhour[24];              /* busy per hour */
  1326.     word busyperday[7][72];            /* busy per DOW, 20 minute intervals */
  1327. }
  1328. timelogrec;
  1329.  
  1330. /*---------------------------------------------------------------------------*/
  1331.  
  1332. typedef struct          /* VOTING.DAT - Voting records */
  1333. {
  1334.     boolean active;                    /* active? */
  1335.     string question[80];               /* voting question */
  1336.     acstring voteacs;                  /* voting ACS */
  1337.     acstring addacs;                   /* add answer ACS */
  1338.     word numusers;                     /* # of users answering */
  1339.     byte numans;                       /* # of active answers */
  1340.     struct
  1341.     {
  1342.         string desc[61];               /* answer description */
  1343.         word numres;                   /* # votes for this answer */
  1344.     }
  1345.     answer[NUMVOTEAS];
  1346. }
  1347. voterec;
  1348.  
  1349. /*****************************************************************************/
  1350. /* ---------------------- EXTERNAL DATA STRUCTURES ------------------------- */
  1351. /*****************************************************************************/
  1352.  
  1353. /*
  1354.     The following structures are all derived from external sources and are
  1355.     not internal to Telegard 3.0 (i.e. the same format listed below is used
  1356.     for all other compatible products using the same specifications).
  1357.  
  1358.     For more information on the structures which are listed below, please
  1359.     refer to the DEVEL300.DOC documentation, which contains contact
  1360.     information and further reference listings for these structures.
  1361. */
  1362.  
  1363. /*****************************************************************************/
  1364. /* ------------ NODELIST FILE STRUCTURES ("VERSION 6" FORMAT) -------------- */
  1365. /*****************************************************************************/
  1366.  
  1367. typedef struct          /* NODELIST.DAT status flags */
  1368. {
  1369.     bit hub : 1;                       /* node is a net hub */
  1370.     bit host : 1;                      /* node is a net host */
  1371.     bit region : 1;                    /* node is a region coord */
  1372.     bit zone : 1;                      /* node is a zone coord
  1373.     bit cm : 1;                        /* runs continuous mail */
  1374.     bit ores1 : 1;                     /* reserved for Opus */
  1375.     bit ores2 : 1;                     /* reserved for Opus */
  1376.     bit ores3 : 1;                     /* reserved for Opus */
  1377.     bit ores4 : 1;                     /* reserved for Opus */
  1378.     bit ores5 : 1;                     /* reserved for Opus */
  1379.     bit nores1 : 1;                    /* reserved for non-Opus */
  1380.     bit nores2 : 1;                    /* reserved for non-Opus */
  1381.     bit nores3 : 1;                    /* reserved for non-Opus */
  1382.     bit nores4 : 1;                    /* reserved for non-Opus */
  1383.     bit nores5 : 1;                    /* reserved for non-Opus */
  1384.     bit nores6 : 1;                    /* reserved for non-Opus */
  1385. }
  1386. nodeflags;
  1387.  
  1388. typedef struct          /* NODELIST.DAT modem type flags */
  1389. {
  1390.     bit hst : 1;                       /* node uses a USRobotics HST modem */
  1391.     bit pep : 1;                       /* node uses a Telebit PEP modem */
  1392.     bit v32 : 1;                       /* node uses a V.32 modem */
  1393.     bit v32b : 1;                      /* node uses a V.32bis modem */
  1394.     bit h96 : 1;                       /* node uses a Hayes Express96 modem */
  1395. }
  1396. modemtypes;
  1397.  
  1398. typedef struct          /* NODELIST.DAT - Version 6 nodelist data */
  1399. {
  1400.     integer net;                       /* net number */
  1401.     integer node;                      /* node number */
  1402.     integer cost;                      /* cost per minute to call */
  1403.     byte name[34];                     /* node name */
  1404.     byte phone[40];                    /* phone number */
  1405.     byte city[30];                     /* city and state */
  1406.     byte password[8];                  /* password */
  1407.     integer realcost;                  /* phone company's charge */
  1408.     integer hubnode;                   /* node # of this nodes hub (0=none) */
  1409.     byte rate;                         /* actual bps rate divided by 300 */
  1410.     modemtypes modem;                  /* modem type codes */
  1411.     nodeflags flags;                   /* set of flags */
  1412.     byte res[2];                       /* RESERVED */
  1413. }
  1414. nodedatarec;
  1415.  
  1416. typedef struct          /* NODELIST.IDX - Version 6 nodelist index */
  1417. {
  1418.     integer node;                      /* node number */
  1419.     integer net;                       /* net number */
  1420. }
  1421. nodeindexrec;
  1422.  
  1423.  
  1424. /*****************************************************************************/
  1425. /* ------------------- QWK OFFLINE MAIL FILE STRUCTURES -------------------- */
  1426. /*****************************************************************************/
  1427.  
  1428. typedef struct          /* MESSAGES.DAT - Message file header record */
  1429. {
  1430.     char status;                       /* message status flag:
  1431.                                           ' ' = public, unread
  1432.                                           '-' = public, read
  1433.                                           '+' = private, unread
  1434.                                           '*' = private, read
  1435.                                           '~' = comment to SysOp, unread
  1436.                                           '`' = comment to SysOp, read
  1437.                                           '%' = password protected, unread
  1438.                                           '^' = password protected, read
  1439.                                           '!' = group password, unread
  1440.                                           '#' = group password, read
  1441.                                           '$' = group password to all */
  1442.     char number[7];                    /* message number */
  1443.     char date[8];                      /* date (MM-DD-YY) */
  1444.     char time[5];                      /* time (HH:MM) */
  1445.     char msgto[25];                    /* To (uppercase) */
  1446.     char msgfrom[25];                  /* From (uppercase) */
  1447.     char subject[25];                  /* Subject */
  1448.     char password[12];                 /* password */
  1449.     char reference[8];                 /* reference message number */
  1450.     char blocks[6];                    /* # of blocks in message,
  1451.                                            including header block */
  1452.     byte active;                       /* $E1=active, $E2=to be deleted */
  1453.     word areanum;                      /* QWK area number */
  1454.     byte res[2];                       /* RESERVED */
  1455.     char tagline;                      /* contains network tagline :
  1456.                                           '*' = network tagline present
  1457.                                           ' ' = no tagline present */
  1458. }
  1459. qdatrec;
  1460.  
  1461. typedef struct          /* *.NDX - Message area index record */
  1462. {
  1463.     longint recnum;                    /* record number in MESSAGES.DAT,
  1464.                                           stored in Microsoft MKS$ format */
  1465.     byte areanum;                      /* area number (unused) */
  1466. }
  1467. qndxrec;
  1468.  
  1469. /****************************************************************************/
  1470. /* --------------------------- JAM STRUCTURES ----------------------------- */
  1471. /****************************************************************************/
  1472.  
  1473. typedef struct          /* *.JHR - JAM message base header - first record */
  1474. {
  1475.     char signature[4];                 /* message signature
  1476.                                           <J><A><M> followed by <NUL> */
  1477.     longint datecreated;               /* creation date */
  1478.     longint modeifycount;              /* modification counter */
  1479.     longint activemsgs;                /* active messages */
  1480.     longint passwordCRC;               /* CRC of password, -1 = none */
  1481.     longint basemsgnum;                /* lowest number in index */
  1482.     char reserved[1000];               /* reserved by JAM authors */
  1483. }
  1484. jaminforec;
  1485.  
  1486. typedef struct          /*  JAM message base attributes */
  1487. {
  1488.     bit jlocal : 1;                    /* local */
  1489.     bit jintransit : 1;                /* in-transit */
  1490.     bit jprivate : 1;                  /* private */
  1491.     bit jread : 1;                     /* read by receiver */
  1492.     bit jsent : 1;                     /* sent */
  1493.     bit jkillsent : 1;                 /* kill msg/sent */
  1494.     bit jarchivesent : 1;              /* archive msg/sent */
  1495.     bit jhold : 1;                     /* hold */
  1496.     bit jcrash : 1;                    /* crash */
  1497.     bit jimmediate : 1;                /* immediate */
  1498.     bit jdirect : 1;                   /* direct */
  1499.     bit jgate : 1;                     /* gate *
  1500.     bit jfilereq : 1;                  /* file requests */
  1501.     bit jfileattach : 1;               /* file attached */
  1502.     bit jtruncfiles : 1;               /* truncate (0 len) sent file */
  1503.     bit jillfiles : 1;                 /* kill sent files */
  1504.     bit jreceiptreq : 1;               /* receipt requested */
  1505.     bit jconfirmreq : 1;               /* confirmation of receipt */
  1506.     bit jorphan : 1;                   /* orpahned message */
  1507.     bit jencrypt : 1;                  /* encrypted message(*) */
  1508.     bit jcompress : 1;                 /* compressed message(*) */
  1509.     bit jescaped : 1;                  /* escaped message(*) */
  1510.     bit jforcepickup : 1;              /* force pickup */
  1511.     bit jtypelocal : 1;                /* local only */
  1512.     bit jtypeecho : 1;                 /* for echo dist'n */
  1513.     bit jtypenet : 1;                  /* for netmai dist'n */
  1514.     bit jRESERVED : 1;                 /* 0x04000000L */
  1515.     bit jRESERVED1 : 1;                /* 0x08000000L */
  1516.     bit jRESERVED2 : 1;                /* 0x10000000L */
  1517.     bit jnomsgdisplay : 1;             /* no message display */
  1518.     bit jlocked : 1;                   /* locked message */
  1519.     bit jdeleted : 1;                  /* deleted message */
  1520. }
  1521. jammsgattr;
  1522.  
  1523.  
  1524. typedef struct          /* *.JHR - JAM message headers */
  1525. {
  1526.     char signature[4];                 /* message signature */
  1527.                                        /* <J><A><M> followed by <NUL> */
  1528.     word revision;                     /* JAM revision level */
  1529.     word reserved1;                    /* reserved by JAM authors */
  1530.     longint subfieldlen;               /* length of subfields */
  1531.     longint timesread;                 /* # times message read */
  1532.     longint msgidCRC;                  /* CRC-32 of MSGID line */
  1533.     longint replyCRC;                  /* CRC-32 of REPLY line */
  1534.     longint replyto;                   /* reply to # */
  1535.     longint reply1st;                  /* 1st reply number */
  1536.     longint replynext;                 /* reply next */
  1537.     unixtime date;                     /* date written */
  1538.     unixtime datercvd;                 /* date received */
  1539.     unixtime dateproc;                 /* date processed (tosser/scanner) */
  1540.     longint msgnum;                    /* message number */
  1541.     jammsgattr attribute;              /* attributes */
  1542.     longint reserved2;                 /* reserved by JAM authors */
  1543.     longint textoffset;                /* offset of text in *.JDT file */
  1544.     longint textlen;                   /* length of text */
  1545.     longint passwordCRC;               /* CRC-32 of password */
  1546.     longint cost;                      /* cost of message */
  1547. }
  1548. jamhdrrec;
  1549.  
  1550. typedef struct          /* *.JHR - subfield records */
  1551. {
  1552.     word fieldid;                      /* subfield ID */
  1553.     word reserved1;                    /* reserved by JAM authors */
  1554.     longint datalen;                   /* length of buffer */
  1555. }
  1556. jamsubfieldrec;
  1557.  
  1558. typedef struct          /* *.JDX - JAM quick index */
  1559. {
  1560.     longint userCRC;                   /* CRC-32 of receipients name (lower) */
  1561.     longint hdroffset;                 /* offset to jamhdrrec */
  1562. }
  1563. jamindexrec;
  1564.  
  1565. typedef struct          /* *.JLR - JAM last read storage */
  1566. {
  1567.     longint userCRC;                   /* CRC-32 of users name (lower) */
  1568.     longint userID;                    /* unique user-ID */
  1569.     longint lastread;                  /* lastread pointer */
  1570.     longint highread;                  /* high read pointer */
  1571. }
  1572. jamreadrec;
  1573.  
  1574. /****************************************************************************/
  1575. /* ------------------------- SQUISH STRUCTURES ---------------------------- */
  1576. /****************************************************************************/
  1577.  
  1578. typedef struct          /* *.SQD - Squish message base header - first record*/
  1579. {
  1580.     word len_sqbase;                   /* length of this structure */
  1581.     word reserved;                     /* RESERVED */
  1582.     longint nummsgs;                   /* number of messages */
  1583.     longint highmsg;                   /* highest message(=nummsgs) */
  1584.     longint keepmsgs;                  /* # of messages to keep */
  1585.     longint hwmsgid;                   /* High Water message msg-ID # */
  1586.     longint lastmsgid;                 /* Last message msg-ID # */
  1587.     char basename[80];                 /* basename for Squishfile */
  1588.     longint beginframe;                /* offset to first message header */
  1589.     longint lastframe;                 /* offset to last message header */
  1590.     longint freeframe;                 /* offset to first FREE header */
  1591.     longint lastfreeframe;             /* offset to last FREE header */
  1592.     longint endframe;                  /* offset to end of file */
  1593.     longint maxmsgs;                   /* maximum number of messages */
  1594.     word keepdays;                     /* days to keep messages */
  1595.     word sqhdrsize;                    /* sice of header record */
  1596.     byte reserved2[124];               /* RESERVED */
  1597. }
  1598. sqbaserec;
  1599.  
  1600. typedef struct          /* *.SQD - Message header */
  1601. {
  1602.     longint sqid;                      /* squish ID - $AFAE4453 */
  1603.     longint nextmsg;                   /* offset to last message */
  1604.     longint prevmsg;                   /* offset to previous message */
  1605.     longint framelength;               /* length of header & message */
  1606.     longint msglength;                 /* length of message */
  1607.     longint ctrllength;                /* length of control information */
  1608.     word headertype;                   /* Header type
  1609.                                           Message = 0
  1610.                                           Free    = 1 */
  1611.     word reserved;                     /* RESERVED */
  1612. }
  1613. sqhdrrec;
  1614.  
  1615. typedef struct          /* Squish Message Attributes */
  1616. {
  1617.     bit sprivate : 1;                  /* private */
  1618.     bit scrash : 1;                    /* crash */
  1619.     bit sread : 1;                     /* read by receiver */
  1620.     bit ssent : 1;                     /* sent */
  1621.     bit sfileattach : 1;               /* files attached */
  1622.     bit sintransit : 1;                /* in-transit */
  1623.     bit sorphan : 1;                   /* orphaned message */
  1624.     bit skillsent : 1;                 /* kill msg/sent */
  1625.     bit slocal : 1;                    /* local  */
  1626.     bit shold : 1;                     /* hold */
  1627.     bit sreserved : 1;                 /* reserved */
  1628.     bit sfilereq : 1;                  /* file requests */
  1629.     bit sreceiptreq : 1;               /* receipt requested */
  1630.     bit sconfirmreq : 1;               /* confirmation of receipt */
  1631.     bit saudit : 1;                    /* audit trail requested */
  1632.     bit supdate : 1;                   /* update request */
  1633.     bit sscanned : 1;                  /* echomail scanned */
  1634.     bit smsgid : 1;                    /* valid msgid? */
  1635.     bit sres1 : 1;                     /* reserved */
  1636.     bit sres2 : 1;
  1637.     bit sres3 : 1;
  1638.     bit sres4 : 1;
  1639.     bit sres5 : 1;
  1640.     bit sres6 : 1;
  1641.     bit sres7 : 1;
  1642.     bit sres8 : 1;
  1643.     bit sres9 : 1;
  1644.     bit sres10 : 1;
  1645.     bit sres11 : 1;
  1646.     bit sres12 : 1;
  1647.     bit sres13 : 1;
  1648.     bit sres14 : 1;
  1649. }
  1650. sqshmsgattr;
  1651.  
  1652.  
  1653. typedef struct          /* *.SQD - Message Info Header */
  1654. {
  1655.     sqshmsgattr attribute;             /* Message attributes */
  1656.     char msgfrom[36];                  /* Message from - NUL terminated */
  1657.     char msgto[36];                    /* Message to - NUL terminated */
  1658.     char subject[72];                  /* Message subject - NUL terminated */
  1659.     struct
  1660.     {
  1661.         word zone, net,
  1662.              node, point;
  1663.     } origaddr, destaddr;              /* Origin/Destination addresses */
  1664.     bitmapdate origdate;               /* Original date (utc) */
  1665.     bitmapdate msgdate;                /* Arrival (system) date (utc) */
  1666.     word utcoffset;                    /* Minutes offset of UTC */
  1667.     longint replyto;                   /* Reply-to msg-ID # */
  1668.     longint replies[9];                /* Replies msg-ID # */
  1669.     longint msgid;                     /* Message ID */
  1670.     char rawdate[20];                  /* ASCII date - NUL terminated */
  1671. }
  1672. sqxmsgrec;
  1673.  
  1674. typedef struct          /* *.SQI - Squish Message Index */
  1675. {
  1676.     longint msgptr;                    /* offset of sqfhdr record */
  1677.     longint msgid;                     /* msg-ID # */
  1678.     longint hash;                      /* hash of 'To' name */
  1679. }
  1680. sqindexrec;
  1681.  
  1682. typedef struct          /* *.SQL - Squish Last Read Index */
  1683. {
  1684.     longint msgid;                     /* msg-ID # */
  1685. }
  1686. sqreadrec;
  1687.  
  1688. /****************************************************************************/
  1689. /* ------------------------ TESTINFO.DAT FORMAT --------------------------- */
  1690. /****************************************************************************/
  1691.  
  1692.  
  1693. typedef struct          /* TESTINFO.DAT - individual file record */
  1694. {
  1695.     boolean sfx;                       /* is self-extracting file? */
  1696.     boolean exists;                    /* file exists */
  1697.     string full_path[61];              /* full file path */
  1698.     string path[61];                   /* file path */
  1699.     string drive[3];                   /* file drive (incl colon) */
  1700.     string name[9];                    /* filename (raw) */
  1701.     string ext[4];                     /* extension */
  1702.     string filetype[4];                /* file type(*) */
  1703.     longint date;                      /* file date_time (packed) */
  1704.     longint size;                      /* file size */
  1705. }
  1706. testinfofilerec;
  1707.  
  1708. typedef struct          /* TESTINFO.DAT */
  1709. {
  1710.     boolean processed;                 /* record has been processed */
  1711.     boolean desc_vendinfo;             /* vendinfo.diz description */
  1712.     boolean desc_import;               /* import descriptions? */
  1713.     boolean addtofbd;                  /* add file to file data base */
  1714.     boolean file_conv;                 /* file converted? */
  1715.     boolean user_ansi;                 /* detected ansi */
  1716.     boolean user_avatar;               /* detected avatar */
  1717.     boolean user_carrier;              /* carrier detected last check */
  1718.     byte reserved1[9];                 /* RESERVED */
  1719.     byte check_count;                  /* update/check count */
  1720.     byte bbs_type;                     /* BBS type (TG3.0 = 6) */
  1721.     byte user_comport;                 /* user com port */
  1722.     byte exit_level;                   /* exit level for test */
  1723.     byte revision;                     /* testinfo.dat revision level */
  1724.     byte reserved2[9];                 /* RESERVED */
  1725.     longint test_datetime;             /* testing date/time */
  1726.     byte reserved3[40];                /* RESERVED */
  1727.     string thd_options[61];            /* THDPRO command line options */
  1728.     string bbs_path[61];               /* path to BBS data files */
  1729.     string creator[61];                /* TESTINFO.DAT creator */
  1730.     string thd_log[61];                /* THDPRO log path */
  1731.     byte reserved4[183];               /* RESERVED */
  1732.     string ver_major[3];               /* creator - major version */
  1733.     string ver_minor[3];               /* creator - minor version */
  1734.     string thd_session[4];             /* THDPRO session number */
  1735.     string desc_filename[13];          /* description file filename */
  1736.     byte reserved5[39];                /* RESERVED */
  1737.     testinfofilerec file_original;     /* original file information */
  1738.     testinfofilerec file_finished;     /* finished file information */
  1739.     byte reserved6[10];                /* RESERVED */
  1740.     integer desc_length;               /* length of description */
  1741.     char desc[1500];                   /* description */
  1742. }
  1743. testinforec;
  1744.  
  1745. #endif
  1746.